﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using TGBTech.Core.Models.Services;

namespace TGBTech.WebAdmin.Controllers
{
    public class BangTongHopCongNoController : Controller
    {
        //
        // GET: /BangTongHopCongNo/
        public ActionResult Index()
        {
            return View();
        }

        public ActionResult Create()
        {
            return View("Create");             
        }

        [HttpPost]
        public ActionResult Create(DateTime startDate, DateTime endDate, String MaTK)
        {
            //check valid date 
            if (startDate != null && endDate != null && startDate <= endDate && MaTK != null)
            {
                var bangcongno = (new BangTongHopCongNoService()).createBangTongHopCongNo(startDate, endDate, MaTK);
                return View("Create", bangcongno);
            }
            return View();
        }
	}
}